home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Original Shareware 1.1
/
The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso
/
36
/
vfos_dv.zip
/
VIO_DV.INC
< prev
Wrap
Text File
|
1988-10-30
|
16KB
|
538 lines
;
; VFOS_IBM VFOSSIL driver by Bob Hartman (SysOp of 1:132/101).
; Copyright 1988 by Spark Software. ALL RIGHTS RESERVED.
;* Modified version for DESQview, David Page (1:109/604)
VioGetMode proc far
Enter_Vio
Check_Handle 00
DESQview_shadow
les di,[bp+8] ; get pointer to buffer
mov cx,es:[di] ; get length
push cs ; set up ds
pop ds
mov si,offset mode_info ; get pointer to mode buffer
cmp cx,es:[di] ; how does it stack up
jbe f00_100 ; it looks ok
mov cx,es:[di] ; get the other value
f00_100:
cmp cx,3 ; is it less than 3
jae f00_101 ; it is still good
mov ax,382 ; bad buffer size
jmp f00_out ; get out
f00_101:
cld
repnz movsb ; move the data
mov ax,0 ; set up return code
Exit_Vio 00,6 ; get out
VioGetMode endp
VioSetMode proc far
mov ax,355
ret 6
VioSetMode endp
VioGetConfig proc far
Enter_Vio
Check_Handle 02
DESQview_shadow
les di,[bp+8] ; get pointer to buffer
mov cx,es:[di] ; get length
push cs ; set up ds
pop ds
mov si,offset mode_info ; get pointer to mode buffer
cmp cx,es:[di] ; how does it stack up
jbe f02_100 ; it looks ok
mov cx,es:[di] ; get the other value
f02_100:
cld
repnz movsb ; move the data
mov ax,0 ; set up return code
Exit_Vio 02,6 ; get out
VioGetConfig endp
VioWrtTTY proc far
Enter_Vio
Check_Handle 03
DESQview_shadow
push cs
pop ds
mov ax,ansi_state ; get current ANSI mode
mov cx,[bp+8] ; get string length
lds dx,[bp+10] ; get pointer to string
or ax,ax ; are we in ANSI mode?
jz f03_100 ; no ANSI, do it the other way
mov ah,40h ; set up for a write call
mov bx,1 ; use stdout
int 21h ; go do it
jmp f03_ok ; get out
f03_100:
mov si,dx ; get the pointer to ds:si
f03_101:
lodsb ; get a byte
mov ah,0eh ; write TTY mode
mov bh,0 ; page number
int 10h ; go do it through the BIOS
loop f03_101 ; do another one
f03_ok:
mov ax,0 ; say it was all ok
Exit_Vio 03,8 ; get out
VioWrtTTY endp
VioGetANSI proc far
Enter_Vio
Check_Handle 04
DESQview_shadow
push cs
pop ds
mov ax,ansi_state ; get current ansi state
les di,[bp+8] ; get pointer for where to put it
stosw ; mov it there
mov ax,0 ; all is ok
Exit_Vio 04,6 ; get out
VioGetANSI endp
VioSetANSI proc far
Enter_Vio
Check_Handle 05
DESQview_shadow
lds si,[bp+8] ; get the pointer to the state
lodsw ; get the state
push cs
pop ds
mov ansi_state,ax ; save it away
mov ax,0 ; all ok
Exit_Vio 05,6 ; get out
VioSetANSI endp
VioGetCurPos proc far
Enter_Vio
Check_Handle 06
DESQview_shadow
mov ah,3 ; get cursor position BIOS call
mov bh,0
int 10h ; actually get it
les di,[bp+8] ; get the pointer to the row
mov dh,al ; save row in al
xor ah,ah ; clear out ah
stosw ; store the row
les di,[bp+12] ; get the pointer to the column
mov dl,al ; get the column to al
stosw ; store the column
mov ax,0 ; all ok
Exit_Vio 06,10 ; get out
VioGetCurPos endp
VioSetCurPos proc far
Enter_Vio
Check_Handle 07
DESQview_shadow
mov ah,2 ; BIOS call to set the cursor pos
mov bh,0
mov dh,byte ptr [bp+10] ; get the row
cmp dh,0 ; check to see it is ok
jae f07_100
mov ax,358 ; no good
jmp f07_out
f07_100:
cmp dh,24 ; check it again
jbe f07_101
mov ax,358 ; no good
jmp f07_out
f07_101:
mov dl,byte ptr [bp+8] ; get the column
cmp dl,0 ; check if it is ok
jae f07_102
mov ax,359 ; no good
jmp f07_out
f07_102:
cmp dl,79 ; check it again
jbe f07_103
mov ax,359 ; no good
jmp f07_out
f07_103:
int 10h ; do the BIOS call
mov ax,0 ; all ok
Exit_Vio 07,6 ; get out
VioSetCurPos endp
VioGetCurType proc far
Enter_Vio
Check_Handle 08
DESQview_shadow
;*routine below duplicated from original subfunction 0 code for
;*DESQview's benefit
mov ah,3 ;* read cursor position
mov bh,0 ;* for video page 0
int 10h
xor ah,ah ;* zero ah
mov al,ch ;* get starting scan line of cursor
mov curs_info.curs_start,ax ;* put it into table
mov al,cl ;* get ending scan line of cursor
mov curs_info.curs_end,ax ;* put it into table
;* end of borrowed routine, now REAL cursor info should be there
les di,[bp+8] ; get pointer to buffer
push cs ; set up ds
pop ds
mov si,offset curs_info ; get pointer to cursor info
mov cx,8 ; length of cursor info
cld
repnz movsb ; move the data
mov ax,0 ; set up return code
Exit_Vio 08,6 ; get out
VioGetCurType endp
VioSetCurType proc far
Enter_Vio
Check_Handle 09
DESQview_shadow
mov ax,cs
mov es,ax
mov ds,ax
lds si,[bp+8] ; get pointer to buffer
mov ch,byte ptr ds:[si] ;* get starting line
mov cl,byte ptr ds:[si+2] ;* get ending line
mov ax,ds:[si+6] ; get attribute
jmp f09_100 ;* disable cursor attribute
cmp ax,-1 ; is it off?
jne f09_100 ; no, so continue
mov ch,30h ; turn off cursor
mov cl,30h ; turn off cursor
f09_100:
mov ah,1 ;* set cursor type BIOS
mov bh,0 ;* for video page zero
int 10h ; use BIOS to set the position
mov di,offset curs_info ; get pointer to cursor info
lds si,[bp+8] ; get pointer to buffer
mov cx,8 ; length of cursor info
cld
repnz movsb ; move the data
mov ax,0 ; set up return code
Exit_Vio 09,6 ; get out
VioSetCurType endp
VioScrollUp proc far
Enter_Vio
Check_Handle 10
DESQview_shadow
; set up address of upper left corner, checking for out of range
; check bottom right corner for out of range
; determine number of words to copy per line
; determine number of rows to do
; move each line
; fill in blanked lines
mov ax,116
Exit_Vio 10,16 ; get out
VioScrollUp endp
VioScrollDn proc far
Enter_Vio
Check_Handle 11
DESQview_shadow
; set up address of upper left corner, checking for out of range
; check bottom right corner for out of range
; determine number of words to copy per line
; determine number of rows to do
; move each line
; fill in blanked lines
mov ax,116
Exit_Vio 11,16 ; get out
VioScrollDn endp
VioReadCellStr proc far
Enter_Vio
Check_Handle 12
DESQview_shadow
Do_Row_Col 12,10,8
mov si,di ; get the address as source index
mov ax,adapter_base ; offset for color card
mov ds,ax ; ds:si is now set up
les di,[bp+14] ; get the pointer to count
mov cx,es:[di]; ; put count in cx
les di,[bp+18] ; get the pointer in es:di
cld
repnz movsb ; move the bytes
mov ax,0 ; successful return
Exit_Vio 12,14 ; get out
VioReadCellStr endp
VioReadCharStr proc far
Enter_Vio
Check_Handle 13
DESQview_shadow
Do_Row_Col 13,10,8
mov si,di ; get the address as source index
mov ax,adapter_base ; offset for color card
mov ds,ax ; ds:si is now set up
les di,[bp+14] ; get length pointer
mov cx,es:[di] ; get length
les di,[bp+18] ; get the pointer in es:di
f13_100:
movsb ; move a byte
inc di ; get past attribute
loop f13_100 ; do the next one
mov ax,0 ; successful return
Exit_Vio 13,14 ; get out
VioReadCharStr endp
VioWrtCellStr proc far
Enter_Vio
Check_Handle 14
DESQview_shadow
Do_Row_Col 14,10,8
mov ax,adapter_base ; offset for color card
mov es,ax ; es:di is now set up
mov cx,[bp+12] ; get length
lds si,[bp+14] ; get the pointer in ds:si
cld
repnz movsb ; move the bytes
mov ax,0 ; successful return
Exit_Vio 14,12 ; get out
VioWrtCellStr endp
VioWrtCharStr proc far
Enter_Vio
Check_Handle 15
DESQview_shadow
Do_Row_Col 15,10,8
mov ax,adapter_base ; offset for color card
mov es,ax ; es:di is now set up
mov cx,[bp+12] ; get length
lds si,[bp+14] ; get the pointer in ds:si
f15_100:
movsb ; move a byte
inc di ; get past attribute
loop f15_100 ; do the next one
mov ax,0 ; successful return
Exit_Vio 15,12 ; get out
VioWrtCharStr endp
VioWrtCharStrAtt proc far
Enter_Vio
Check_Handle 16
DESQview_shadow
Do_Row_Col 16,14,12
mov ax,adapter_base ; offset for color card
mov es,ax ; es:di is now set up
mov cx,[bp+16] ; get length
lds si,[bp+8] ; get the pointer in ds:si
lodsb ; get the attribute
mov ah,al ; save the attribute
lds si,[bp+18] ; get the pointer to chars
f16_100:
lodsb ; get the character
xchg ah,al ; put in proper order
stosw ; save the cell
xchg ah,al ; save attribute again
loop f16_100 ; loop for next one
mov ax,0 ; successful return
Exit_Vio 16,16 ; get out
VioWrtCharStrAtt endp
VioWrtNAttr proc far
Enter_Vio
Check_Handle 17
DESQview_shadow
Do_Row_Col 17,10,8
mov ax,adapter_base ; offset for color card
mov es,ax ; es:di is now set up
mov cx,[bp+12] ; get length
lds si,[bp+14] ; get the pointer in ds:si
lodsb ; get the character attribute
f17_100:
inc di ; get past character byte
stosb ; save the attribute
loop f17_100 ; loop for next one
mov ax,0 ; successful return
Exit_Vio 17,12 ; get out
VioWrtNAttr endp
VioWrtNCell proc far
Enter_Vio
Check_Handle 18
DESQview_shadow
Do_Row_Col 18,10,8
mov ax,adapter_base ; offset for color card
mov es,ax ; es:di is now set up
mov cx,[bp+12] ; get length
lds si,[bp+14] ; get the pointer in ds:si
lodsw ; get the character cell in AX
cld
repnz stosw ; save the cell
mov ax,0 ; successful return
Exit_Vio 18,12 ; get out
VioWrtNCell endp
VioWrtNChar proc far
Enter_Vio
Check_Handle 19
DESQview_shadow
Do_Row_Col 19,10,8
mov ax,adapter_base ; offset for color card
mov es,ax ; es:di is now set up
mov cx,[bp+12] ; get length
lds si,[bp+14] ; get the pointer in ds:si
lodsb ; get the character
f19_100:
stosb ; save the character
inc di ; get past attribute byte
loop f19_100 ; loop for next one
mov ax,0 ; successful return
Exit_Vio 19,12 ; get out
VioWrtNChar endp